<table cellpadding="5">
	<input name="id" type="hidden" value="${(transOrderItem.id)!}" />
	<tr>
		<td class="tbLabel">运单号:</td>
		<td>
			<input name="orderNo"  class="easyui-validatebox textbox" data-options="required: true" value="${(transOrderItem.orderNo)!}" validType="remote['transOrder.do?checkOrderNoIsExit&id=${(transOrderItem.id)!}','orderNo']" invalidMessage="运单号已存在"/>
		</td>
		<td class="tbLabel">运单状态:</td>
		<td>
			<@eu.comboBox name="orderStatus" disabled="true" required="true" url="common.do?loadComboBox&key=ORDER_STATUS&value=${(transOrderItem.orderStatus)!}" />
		</td>
		<td class="tbLabel">起始站:</td>
		<td>
			<@eu.comboBox url="transWebSite.do?loadWebsiteCombox&value=${(transOrderItem.startWebsiteId)!}" required="true" name="startWebsiteId" disabled="${disabledWebsite!'false'}"/>
		</td>
		<td class="tbLabel">目的站:</td>
		<td>
			<@eu.comboBox url="transWebSite.do?loadWebsiteCombox&value=${(transOrderItem.endWebsiteId)!}" required="true" name="endWebsiteId"/>
		</td>
		<td class="tbLabel">接单时间:</td>
		<td>
			<input name="receiveTime"  class="easyui-datetimebox" data-options="required: true" value="${(transOrderItem.receiveTime)!}"/>
		</td>
	</tr>
	<tr>
		<td colspan="10">
			 <div class="easyui-panel" data-options="border: false" title="寄件人和收件人信息">
		 	 </div>
		</td>
	</tr>
	<tr>
		<td>寄件单位:</td>
		<td colspan="3">
			<input name="sendUnit"  class="easyui-validatebox textbox" data-options="required: true" value="${(transOrderItem.sendUnit)!}"/>
		</td>
		<td>收件单位:</td>
		<td colspan="3">
			<input name="receiveUnit"  class="easyui-validatebox textbox" data-options="required: true" value="${(transOrderItem.receiveUnit)!}"/>
		</td>
	</tr>
	<tr>
		<td>寄件人:</td>
		<td colspan="3">
			<input name="sender"  class="easyui-validatebox textbox" data-options="required: true" value="${(transOrderItem.sender)!}"/>
		</td>
		<td>收件人:</td>
		<td colspan="3">
			<input name="receiver"  class="easyui-validatebox textbox" data-options="required: true" value="${(transOrderItem.receiver)!}"/>
		</td>
		
	</tr>
	<tr>
		<td>寄件电话:</td>
		<td colspan="3">
			<input name="sendPhone"  class="easyui-validatebox textbox" data-options="required: true" value="${(transOrderItem.sendPhone)!}"/>
		</td>
		
		
		<td>收件电话:</td>
		<td colspan="3">
			<input name="receivePhone"  class="easyui-validatebox textbox" data-options="required: true" value="${(transOrderItem.receivePhone)!}"/>
		</td>
		
	</tr>
	<tr>
		<td>寄件地址:</td>
		<td colspan="3">
			<table>
				<#assign addressHtmlId = "sendAddressHtmlId" addressWidth="100">
				<#macro callbackFun>
					$('#sendAddress').val(addressText);
				</#macro>
				<#include "/base/address.html">
			</table>
		</td>
		<td>收件地址:</td>
		<td colspan="3">
			<table>
				<#assign addressHtmlId = "receiveAddressHtmlId">
				<#macro callbackFun>
					$('#receiveAddress').val(addressText);
				</#macro>
				<#include "/base/address.html">
				
			</table>
		</td>
	</tr>
	<tr>
		<td colspan="4">
			<input id="sendAddress" type="hidden" name="sendRegionAddr" />
			<input  name="sendAddress" style="width:480px;" class="easyui-validatebox textbox" data-options="required: true" value="${(transOrderItem.sendAddress)!}"/>
		</td>
		<td colspan="4">
			<input id="receiveAddress" type="hidden" name="receiveRegionAddr" />
			<input name="receiveAddress" style="width:480px;" class="easyui-validatebox textbox" data-options="required: true" value="${(transOrderItem.receiveAddress)!}"/>
		</td>
	</tr>
	<tr>
		<td colspan="10">
			 <div class="easyui-panel" data-options="border: false" title="货物和结束信息">
		 	 </div>
		</td>
	</tr>
	<tr>
		<td>货物名称:</td>
		<td>
			<input name="goodsName"  class="easyui-validatebox textbox" data-options="required: true" value="${(transOrderItem.goodsName)!}"/>
		</td>
		<td>货物类型:</td>
		<td>
			<input name="goodsType"  class="easyui-validatebox textbox" data-options="required: true" value="${(transOrderItem.goodsType)!}"/>
		</td>
		<td>件数:</td>
		<td>
			<input name="goodsNum"  class="easyui-validatebox textbox" data-options="required: true,width:160" value="${(transOrderItem.goodsNum)!}" />
		</td>
		<td>重量KG:</td>
		<td>
			<input id="orderNoWeight" name="weight"  class="easyui-numberbox" precision="2" data-options="required: true,width:157,onChange:function(newValue,oldValue) {calculateTotalByWeight(newValue)}" value="${(transOrderItem.weight)!}" />
		</td>
	</tr>
	<tr>
		<td>体积:</td>
		<td>
			<input name="volume"  class="easyui-validatebox textbox" data-options="width:160" value="${(transOrderItem.volume)!}" />
		</td>
		<td>运费:</td>
		<td>
			<input id="freight" name="freight"  class="easyui-numberbox"  precision="2" data-options="required: true,width:157,onChange:function(newValue,oldValue) {calculateTotal(newValue,'freight');}" value="${(transOrderItem.freight)!}"/>
		</td>
		<td>保价金额:</td>
		<td>
			<input name="supportSum"  class="easyui-numberbox"  precision="2" data-options="width:157" value="${(transOrderItem.supportSum)!}"/>
		</td>
		<td>保险费:</td>
		<td>
			<input id="premium" name="premium"  class="easyui-numberbox"  precision="2" data-options="width:157,onChange:function(newValue,oldValue) {calculateTotal(newValue,'premium');}" value="${(transOrderItem.premium)!}"/>
		</td>
	</tr>
	<tr>
		<td>代收货款:</td>
		<td>
			<input name="agencyFund"  class="easyui-validatebox textbox" data-options="width:160" value="${(transOrderItem.agencyFund)!}" />
		</td>
		<td>货款手续费:</td>
		<td>
			<input id="agencyHandSum" name="agencyHandSum"  class="easyui-numberbox"  precision="2" data-options="width:157,onChange:function(newValue,oldValue) {calculateTotal(newValue,'agencyHandSum');}" value="${(transOrderItem.agencyHandSum)!}"/>
		</td>
		<td>到付手续费:</td>
		<td>
			<input id="arrivalSum" name="arrivalSum"  class="easyui-numberbox"  precision="2" data-options="width:157,onChange:function(newValue,oldValue) {calculateTotal(newValue,'arrivalSum');}" value="${(transOrderItem.arrivalSum)!}"/>
		</td>
		<td>回单手续费:</td>
		<td>
			<input id="receiveSum" name="receiveSum"  class="easyui-numberbox"  precision="2" data-options="width:157,onChange:function(newValue,oldValue) {calculateTotal(newValue,'receiveSum');}" value="${(transOrderItem.receiveSum)!}"/>
		</td>
		
	</tr>
	<tr>
		<td>其它费用:</td>
		<td>
			<input id="otherSum" name="otherSum"  class="easyui-numberbox"  precision="2" data-options="width:157,onChange:function(newValue,oldValue) {calculateTotal(newValue,'otherSum');}" value="${(transOrderItem.otherSum)!}"/>
		</td>
		<td>是否到付:</td>
		<td>
			<@eu.comboBox name="arrivePay" url="common.do?loadComboBox&key=YON&value=${(transOrderItem.arrivePay)!'false'}" />
		</td>
		<td>合计应收:</td>
		<td>
			<input id="calculateTotal" name="total" readonly="readonly"  class="easyui-numberbox"  precision="2" data-options="width:157" value="${(transOrderItem.total)!}"/>
		</td>
<!-- 		<td>收款网点:</td> -->
<!-- 		<td> -->
<!-- 			<@eu.comboBox url="transWebSite.do?loadWebsiteCombox&value=${(transOrderItem.payWebsiteId)!}" required="true" name="payWebsiteId"/> -->
<!-- 		</td> -->
		<td>业务员:</td>
		<td>
			<input name="creator" type="hidden" value="${(transOrderItem.creator)!}" />
			<input name="salesman"  class="easyui-validatebox textbox" readonly="readonly" value="${(transOrderItem.salesman)!}"/>
		</td>
	</tr>
</table>
<script type="text/javascript">
// 运费+保险费+货款手续费+到付手续费+回单手续费+其他费用
	function calculateTotal(value,id) {
		$('#'+id).numberbox('setValue', value);
		//freight premium agencyHandSum arrivalSum receiveSum
		var afterCalculate = Number($('#freight').numberbox('getValue'))+Number($('#premium').numberbox('getValue'))+Number($('#agencyHandSum').numberbox('getValue'))+Number($('#otherSum').numberbox('getValue'))+Number($('#receiveSum').numberbox('getValue'));
		$('#calculateTotal').numberbox('setValue', afterCalculate.toFixed(2));
	}
	
	function calculateTotalByWeight(value) {
		jmaxAjax('transOrder.do?calTotalByWeight',{weight:value},function(rs) {
// 			$('#freight').numberbox('setValue', rs.obj);
			calculateTotal(rs.obj,'freight');
		},true);
	}
</script>
